package inventoryServe.service.impl;


import inventoryServe.mapper.ProductMapper;
import inventoryServe.po.Product;
import inventoryServe.service.ProductService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
@Transactional
public class ProductServiceImpl  implements ProductService {
    // 注解注入
    @Autowired
    private ProductMapper productMapper;
    @Override
    public List<Product> allProduct(Product product) {

        return this.productMapper.allProduct(product);
    }

    @Override
    public Boolean deleteProduct(Integer id) {
        return this.productMapper.deleteProduct(id) >0;
    }

    @Override
    public Boolean addProduct(Product productr) {
        return this.productMapper.addProduct(productr) > 0;
    }

    @Override
    public Product productOfId(Integer id) {
        return this.productMapper.productOfId(id);
    }

    @Override
    public Boolean editProduct(Product product) {
        return this.productMapper.editProduct(product) > 0;
    }
}
